﻿jQuery(document).ready(function () {
    
    $('body').layout({
        // enable showOverflow on west-pane so popups will overlap north pane
        west__showOverflowOnHover: true,
        west__size: 180,
        north__size: 40,
        south__size: 60
    });

    $.ColorLife.sessionId = $.ColorLife.getQueryString('sessionid');
    $.ColorLife.onPageLoad();
    $("#myModalNewFolder").draggable({
        handle: ".modal-header"
    });
    $("#myModalUpload").draggable({
        handle: ".modal-header"
    });
    $("#myModalHelp").draggable({
        handle: ".modal-header"
    });
    $("#btnCreateFolder").click(function () {
        var ok = $.ColorLife.createNewFolder($("#txtFolderName").val());
        $('#myModalNewFolder').modal('hide');
    });

    $("#btnDelete").click(function () {
        $.ColorLife.deleteSelectedItem();
        $('#myModalDelete').modal('hide');
    });
    $("#btnSaveFileToServer").click(function () {
        var fileUrl = $("#txtSaveFileToServer").val();
       return $.ColorLife.saveFileToServer(fileUrl);
    });
    // $("#_fileContainer").contextMenu(menu1, { theme: 'vista' });

    $(".doUpload").click(function () {
        $.ColorLife.uploadCommand();
    });           
    $("#btnUpload").click(function () {
              $('#myModalUpload').modal('hide');
    });
    
});
